package com.haonan.Utils;

public class CurrentHolder {//线程本地存储
    private static final ThreadLocal<Integer> CURRENT_LOCAL = new ThreadLocal<>();//线程本地存储

    public static void setCurrentId(Integer employeeId) {//设置当前员工id
        CURRENT_LOCAL.set(employeeId);
    }

    public static Integer getCurrentId() {//获取当前员工id
        return CURRENT_LOCAL.get();
    }

    public static void remove() {//删除当前员工id
        CURRENT_LOCAL.remove();
    }
}
